<%@ page import="com.depo.quiggle.view.controller.QglLogPendingAction" %>
<%@ page import="com.depo.quiggle.view.controller.JobDetailEditAction" %>
<%@ page import="com.depo.quiggle.view.controller.JobDetailAccountingEditAction" %>
<%@ page import="com.depo.quiggle.view.controller.JobEditAction" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--@elvariable id="actionBean" type="com.depo.quiggle.view.controller.QglLogPendingAction"--%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jsp" %>
<script>
//currentAction = 0;
currentAction = 0;
currentAction1 = 0;
var actualUserId = '${actionBean.userId}';  
</script>
<div class="infoBut" style="z-index: 99;"><a href="#" id="infoButton"><img src="images/infoicon.png"  alt="Information" border="0" /></a></div>

<div class="dashboard-content">
<div id="rateTableForm" title="Rate Table">
</div>
<div id="save-or-discard"></div>
<!-- Begin Instruction -->
 <div class="instructions" id="instructions">
    <h3 class='qgl'><span class="fright" id="instrutionsSpanForQGL">
					<a href="javascript:{}" title="click here to hide the instructions" id="instructionsHideLinkForQGL" style="background:#E3F2FF;">
						<img  id="instructionsDownarrowimg" src="images/uparrow.png" width="10" height="9" alt="Hide" />
					</a>
				</span>Quick Glance Log</h3>
            	<div id="contentInsForQGL"><strong>At a glance determine:</strong>
<OL>
  <li>How many hours you have to set aside from your life and work to scope, proof and perform administrative tasks (i.e., caption, index and worksheet completion)</li>
<li>Which job is due and when</li>
<li>	Balance outstanding </li>
</OL>
</div>
            
            </div>
<!-- End Instruction -->
<fmt:setBundle basename="help" var="help"/>
    <div class="qgl-pending-list">
        <div id="agency-form" title="Create New Agency" style="display:none;">
		<div id="agency-form-errorMsgDiv" class="fontStyle"></div>
            <p class="agency-validation-tips">All form fields are required.</p>
            <form action="#">
                <fieldset>
                    <div >
                        <input type="hidden" name="block-id" class="block-id" value=""/>
                        <label for="agency-initial">Initial</label>
                        <input type="text" name="name" maxlength="10"  id="agency-initial" class="initial text ui-widget-content ui-corner-all" style="margin-left:4px;"/>
                    </div>
                    <div class="p-5" style="padding:5px 0px 0px;">
                        <label for="agency-name">Name</label>
                        <input type="text" name="email" maxlength="50" id="agency-name" class="text ui-widget-content ui-corner-all t-tip" title="<fmt:message bundle='${help}' key='help.qgl.CREATE_NEW_AGENCY_NAME'/>"/>
                    </div>
                    
                </fieldset>
                 <p style="display:none"> Agency already exists</p>
            </form>
        </div>
        <div id="scopist-form" title="Create New Scopist" style="display:none;">
		<div id="scopist-form-errorMsgDiv" class="fontStyle"></div>
            <p class="agency-validation-tips">All form fields are required.</p>
            <form action="#">
                <fieldset>
                    <div >
                        <input type="hidden" name="block-id" class="block-id" value=""/>
                        <label for="scopist-initial">Initial</label>
                        <input type="text" name="name" maxlength="10" id="scopist-initial" class="initial text ui-widget-content ui-corner-all" style="margin-left:4px;"/>
                    </div>
                    <div class="p-5" style="padding:5px 0px 0px;">
                        <label for="scopist-name">Name</label>
                        <input type="text" name="email" maxlength="50" id="scopist-name" class="text ui-widget-content ui-corner-all t-tip"  title="<fmt:message bundle='${help}' key='help.qgl.CREATE_NEW_SCOPIST_NAME'/>"/>
                    </div>
                </fieldset>
                <p style="display:none"> Scopist already exists</p>
                
            </form>
        </div>
        <div id="proofer-form" title="Create New Proofer" style="display:none;">
		<div id="proofer-form-errorMsgDiv" class="fontStyle"></div>
            <p class="agency-validation-tips">All form fields are required.</p>
            <form action="#">
                <fieldset>
                    <div >
                        <input type="hidden" name="block-id" class="block-id" value=""/>
                        <label for="proofer-initial">Initial</label>
                        <input type="text" name="name"  maxlength="10" id="proofer-initial" class="initial text ui-widget-content ui-corner-all" style="margin-left:4px;"/>
                    </div>
                    <div class="p-5" style="padding:5px 0px 0px;">
                        <label for="proofer-name">Name</label>
                        <input type="text" name="email" maxlength="50" id="proofer-name" class="text ui-widget-content ui-corner-all t-tip" title="<fmt:message bundle='${help}' key='help.qgl.CREATE_NEW_PROOFER_NAME'/>"/>
                    </div>
                </fieldset>
                <p style="display:none"> Proofer already exists</p>
                
            </form>
        </div>
         <div id="estimatePages-form" title="MY HOURS TO PERFORM TASK" style="display:none;">
		   <div id="estimatePages-formInnerDiv"></div>  
        </div>
        <div id="estimatePages-form-new" title="MY HOURS TO PERFORM TASK" style="display:none;">
		   <div id="estimatePages-formInnerDiv-new"></div>  
        </div>   
        
        <!-- DISPLAY SUCCESS MESSAGE AFTER SAVE START--> 
		<%
		if (request.getParameter("savedStatus") != null) {
			%><div class="alert alert-success" id="successDiv"><b>Your Information Saved Successfully</b><button class="close" type="button">×</button></div><%
		}
		%>
		
		<!-- DISPLAY SUCCESS MESSAGE AFTER SAVE END--> 
		
		
         <div> <strong>Select</strong> <select onchange="callQglAction(this.options[this.selectedIndex].value)">
                      <option value="qgl-log-pending.action" selected="selected">Pending</option>
                      <option value="qgl-log-pending-turned-in.action">Turned In</option>
                      <option value="qgl-log-detail.action">Detail</option>
                      <option value="qgl-log-detail-accounting.action">Detail Accounting</option>
                      </select>
         </div>

        <div class="job-table-header">
            <div class="job-row-header-bar">
                <div class="headings f-l">
                    Dashboard Pending

<%--
                    <img id="project-icon" src="images/transparent_1x1.png" class="ui-state-default"/>
                    <input id="project"/>
                    <input type="hidden" id="project-id"/>

                    <input class="agency-initial" id="agency"/>
                    <input class="agency-id" id="agency-id"/>

                    <button id="create-user">Create new user</button>
--%>

                </div>
                <div class="f-r"  id="add-job" ><img alt="Add a job" src="${pageContext.request.contextPath}/images/addnew.png" width="47" height="20" border="0" title="<fmt:message bundle='${help}' key='help.qgl.ADD'/>" class="t-tip"/></div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="job-table">
            <div class="job-th job-row" id="job-placeholder">
                <div class="job-column job-th status" >STATUS</div>
                <div class="job-column job-th agency" >AGENCY</div>
                <div class="job-column job-th date-taken">DATE TAKEN</div>
                <div class="job-column job-th est-pgs" >EST PGS</div>
                <div class="job-column job-th scopist" >SCOPIST</div>
                <div class="job-column job-th proofer" >PROOFER</div>
                <div class="job-column job-th case-name">CASE NAME</div>
                <div class="job-column job-th agency-due">DUE AGENCY</div>
                <div class="job-column job-th total-hrs" >HRS TO DO</div>
                <div class="job-column job-th actions">ACTIONS</div>
                <%--<div class="clear"></div>--%>
            </div>
            <c:set var="jobIndex" value="0"/>
            <c:forEach items="${actionBean.jobs}" var="job" varStatus="jobStatus">
                <form class="job-row job-table" id="job-template-${jobStatus.index}" action="${pageContext.request.contextPath}<%=QglLogPendingAction.URL%>">
                    <div class="job-column status" >
					<fmt:setBundle basename="help" var="help" />
                        <input type="hidden" name="jobId" class="jobId" value="${job.jobId}"/>
                        <span class="view">${job.status.name}</span>
                        <span class="edit">${job.status.name}</span>
<%--
                        <select class="edit" name="job.statusId">
                            <c:forEach items="${actionBean.jobStatuses}" var="jobStat">
                                <option value="${jobStat.id}" ${jobStat.id == job.statusId ? "selected" : ""}>${jobStat.name}</option>
                            </c:forEach>
                        </select>
--%>
                    </div>
                    <div class="job-column agency" id="agency-${jobStatus.index}" >
                    <c:if test="${not empty job.agencyId}">
					 <c:if test="${job.agencyEnabled == true}">  
                        <span id="agencylink${job.jobId}" class="view t-tip" title="<c:if test='${job.agencyRateCode == null}'>No Rate Code Selected For Agency, </c:if><c:if test='${job.agencyRateCode != null}'> Agency Rate Code: ${job.agencyRateCode}, </c:if><fmt:message bundle='${help}' key='help.qgl.dblclck.AGENCY'/>"><a href="javascript:{ getRateTableId(${job.agencyId},${job.jobId },'AGENCY')}">${job.agencyInitial}</a></span>
						
						

						</c:if>
                     </c:if>

                        <input type="hidden" class="agency-id" name="job.agencyId" value="${job.agencyId}"/>
						 
                        
                        <input type="hidden" class="agency-name" name="job.agencyName" value=""/>
						
						 <c:if test="${job.agencyEnabled == false}">                    
                       <span class="view t-tip" title="<fmt:message bundle='${help}' key='help.qgl.dblclck.ARCHIVE'/>"> <a href="javascript:{}">${job.agencyInitial}</a></span>
                       
                      </c:if>
                                    <input  id="agencylink${job.jobId}" class="edit agency-initial  mandatoryfield t-tip " maxlength="10" type="text" name="job.agencyInitial" value="${job.agencyInitial}" title="<c:if test='${job.agencyRateCode == null}'>No Rate Code Selected For Agency, </c:if><c:if test='${job.agencyRateCode != null}'>Agency Rate Code: ${job.agencyRateCode}, </c:if><fmt:message bundle='${help}' key='help.qgl.AGENCY'/>"/>
						
                    </div>
                    <div class="job-column date-taken date">
                        <span class="view">${job.takenDateString}</span>
                        <input class="edit date-picker" type="text" name="job.takenDate" 
                         readonly="readonly" id="job.takenDate-${jobStatus.index}" value="${job.takenDateString}" >
                    </div>
                    <div class="job-column est-pgs number">
                        <span class="view">${job.estimatePages}</span>
                        <input class="edit numberVal t-tip estimatePages" type="text" id="estpages-${jobStatus.index}" onchange="caluculateAllHours(${job.jobId},${jobStatus.index})" name="job.estimatePages" value="${job.estimatePages}" onBlur="caluculateAllHours(${job.jobId},${jobStatus.index});" title="<fmt:message bundle='${help}' key='help.qgl.EST_PGS'/>">
                    </div>
                    <div class="job-column scopist" id="scopist-${jobStatus.index}" >
                    
                    
                    <c:if test="${not empty job.scopistId}">
                     <c:choose>
	                   		 <c:when test="${job.scopistId eq actionBean.userId}">
	                       		 <span class="view">${job.scopistInitial}</span>
                      		</c:when>
                        <c:otherwise>
						 <c:if test="${job.scopistEnabled == true}">
	                        <span id="scopistlink${job.jobId}" class="view t-tip" title="<c:if test='${job.scopiestRateCode == null}'>No Rate Code Selected For Scopiest, </c:if><c:if test='${job.scopiestRateCode != null}'>Scopist Rate Code: ${job.scopiestRateCode}, </c:if><fmt:message bundle='${help}' key='help.qgl.dblclck.SCOPIST'/>"><a href="javascript:{ getRateTableId(${job.scopistId},${job.jobId },'SCOPIST')}">${job.scopistInitial}</a></span>
							</c:if>
							 <c:if test="${job.scopistEnabled == false}">                    
	                        
	                        <span class="view t-tip" title="<fmt:message bundle='${help}' key='help.qgl.dblclck.ARCHIVE'/>"> <a href="javascript:{}">${job.scopistInitial}</a></span>
	                        
	                        </c:if>
	                   </c:otherwise>
	                   </c:choose>
                     </c:if>
                     
                     
                     
                        <input type="hidden" class="scopist-id" id="scopist-id-${jobStatus.index}" name="job.scopistId" value="${job.scopistId}"/>
						
                        <input id="scopistlink${job.jobId}" class="edit scopist-initial t-tip" maxlength="10" type="text" name="job.scopistInitial" value="${job.scopistInitial}" onBlur="caluculateAllHours(${job.jobId},${jobStatus.index})" title="<c:if test='${job.scopiestRateCode == null}'>No Rate Code Selected For Scopiest, </c:if><c:if test='${job.scopiestRateCode != null}'>Scopist Rate Code: ${job.scopiestRateCode}, </c:if><fmt:message bundle='${help}' key='help.qgl.SCOPIST'/>"/>
						
                        <input type="hidden" class="scopist-name" id="scopist-name-${jobStatus.index}" name="job.scopistName" value=""/>
                    </div>
                    <div class="job-column proofer" id="proofer-${jobStatus.index}" >
                    
                     <c:if test="${not empty job.prooferId}">
                      <c:choose>
	                   		 <c:when test="${job.prooferId eq actionBean.userId}">
                          		<span class="view">${job.prooferInitial}</span>
                      		</c:when>
                        	<c:otherwise>
							 <c:if test="${job.prooferEnabled == true}">
                        
                      		 <span id="prooferlink${job.jobId}" class="view t-tip" title="<c:if test='${job.prooferRateCode == null}'>No Rate Code Selected For Proofer, </c:if><c:if test='${job.prooferRateCode != null}'> Proofer Rate Code: ${job.prooferRateCode}, </c:if><fmt:message bundle='${help}' key='help.qgl.dblclck.PROOFER'/>"><a href="javascript:{ getRateTableId(${job.prooferId},${job.jobId },'PROOFER')}">${job.prooferInitial}</a></span>
							 </c:if>
							 <c:if test="${job.prooferEnabled == false}">
                        
                        <span class="view t-tip" title="<fmt:message bundle='${help}' key='help.qgl.dblclck.ARCHIVE'/>"><a href="javascript:{}">${job.prooferInitial}</a></span>
                        
                        </c:if>
	                   		</c:otherwise>
	                   </c:choose>
                    </c:if>
                    
                        <input type="hidden" class="proofer-id" id="proofer-id-${jobStatus.index}" name="job.prooferId" value="${job.prooferId}"/>
						
                        <input id="prooferlink${job.jobId}" class="edit proofer-initial t-tip" maxlength="10" type="text" name="job.prooferInitial" value="${job.prooferInitial}" onBlur="caluculateAllHours(${job.jobId},${jobStatus.index});" title="<c:if test='${job.prooferRateCode == null}'>No Rate Code Selected For Proofer, </c:if><c:if test='${job.prooferRateCode != null}'>Proofer Rate Code: ${job.prooferRateCode}, </c:if><fmt:message bundle='${help}' key='help.qgl.PROOFER'/>"/>
							
                        <input type="hidden" class="proofer-name" id="proofer-name-${jobStatus.index}" name="job.prooferName" value=""/>
                    </div>



                    <div class="job-column case-name">
                        <span class="view">${job.caseName}</span>
                        <input style="max-width: 120px;" class="edit t-tip" type="text" name="job.caseName" value="${job.caseName}" title="<fmt:message bundle='${help}' key='help.qgl.CASE/JOB_NAME'/>">
                    </div>
                    <div class="job-column agency-due  date">
                        <span class="view">${job.agencyDueDateString}</span>
                        <input class="edit date-picker" type="text" name="job.agencyDueDate" readonly="readonly" id="job.agencyDueDate-${jobStatus.index}" value="${job.agencyDueDateString}" >
                    </div>
                    <div class="job-column total-hrs number">
                        <span class="view">${job.toDoHours}</span>
                        <input class="edit t-tip" type="text" id="totalhrs-${jobStatus.index}" readonly="readonly" name="job.toDoHours" value="${job.toDoHours}" title="<fmt:message bundle='${help}' key='help.qgl.HOURS_TO_DO'/>">
                    </div>
                    <input type="hidden" name="newjobIndex" class="newjobIndex" value="${jobStatus.index}"/>
                    <div class="job-column actions">
                        <%--<img alt="Edit" class="view edit-job job-action" src="${pageContext.request.contextPath}/images/edit-icon.png" />
                        <stripes:link href="<%=JobDetailEditAction.URL%>" class="view">
                            <stripes:param name="jobId" value="${job.jobId}"/>
                            <stripes:param name="pendingEdit" value="true"/>
                        <img alt ="Detail" title="Detail" class="view detail-job job-action" src="${pageContext.request.contextPath}/images/detail-icon.png" />
                        </stripes:link>
                        <stripes:link href="<%=JobDetailAccountingEditAction.URL%>" class="view">
                            <stripes:param name="jobId" value="${job.jobId}"/>
                            <stripes:param name="pendingEdit" value="true"/>
                        <img alt ="Detail Accounting" title ="Detail Accounting" class="view detail-job job-action" src="${pageContext.request.contextPath}/images/detail-icon.png" />
                        </stripes:link> --%>
                        
                        <ul class="dd_menu">
						<li><a> <img  class="view detail-job job-action" src="${pageContext.request.contextPath}/images/detail-icon.png" /></a>
						  <ul>
							<li>
							  <a href="javascript:{}" class="view edit-job job-action">Edit </a>
							</li>
							<li>
							    <stripes:link href="<%=JobDetailEditAction.URL%>" class="view">
                                 <stripes:param name="jobId" value="${job.jobId}"/>
                                 <stripes:param name="pendingEdit" value="true"/>
                                    Detail
                                </stripes:link>
							</li>
							<li>
                               <stripes:link href="<%=JobDetailAccountingEditAction.URL%>" class="view">
                                 <stripes:param name="jobId" value="${job.jobId}"/>
                                 <stripes:param name="pendingEdit" value="true"/>
                                    Detail Accounting
                               </stripes:link>
							</li>
							
							</ul>
						</li>
						</ul>
                        
                        <%--<img alt ="Cancel" class="edit cancel-edit job-action" src="${pageContext.request.contextPath}/images/close.png"/>--%>
                        <span class="edit cancel-edit job-action">(X)</span>
                        <input class="edit job-action t-tip" type="submit" name="saveJob"  value="save"  src="${pageContext.request.contextPath}/images/save.gif" title="<fmt:message bundle='${help}' key='help.qgl.SAVE'/>">
                    </div>
					<input type="hidden" id="prooferRateId${job.jobId}"  class="proofer-rate-item-id" name="job.prooferRateItemId" value="${job.prooferRateItemId}"/> 
					<input type="hidden" id="scopistRateId${job.jobId}" class="scopist-rate-item-id" name="job.scopistRateItemId" value="${job.scopistRateItemId}"/>
					<input type="hidden" id="typeId${job.jobId}" class="type-id agency-rate-item" name="job.jobTypeId" value="${job.jobTypeId}"/>
                </form>
                <c:set var="jobIndex" value="${jobStatus.index + 1}"/>
            </c:forEach>
        </div>
        <div id="paginationDiv"></div>
    </div>
</div>


<div class="template-container">
    <div id="job-index">${jobIndex}</div>
    <form class="job-row" id="job-template" action="${pageContext.request.contextPath}<%=QglLogPendingAction.URL%>">
        <div class="job-column status">
            <input type="hidden" name="jobId" value=""/>
            <select name="job.statusId">
                <c:forEach items="${actionBean.jobStatuses}" var="jobStat">
                    <option value="${jobStat.id}">${jobStat.name}</option>
                </c:forEach>
            </select>
        </div>

        <div class="job-column agency" id="agency-{index}" >
            <input type="hidden" class="agency-id" name="job.agencyId" value=""/>
            <input class="agency-initial mandatoryfield t-tip" type="text" maxlength="10" name="job.agencyInitial" value="${job.agencyInitial}" title="<fmt:message bundle='${help}' key='help.qgl.AGENCY'/>"/>
            <input type="hidden" class="agency-name" name="job.agencyName" value=""/>
        </div>

        <div class="job-column date-taken date">
            <input class="date-picker" type="text" name="job.takenDate" id="job.takenDate-{index}" value="" readonly="readonly">
        </div>
        <div class="job-column est-pgs">
            <input type="text" onBlur="saveHrsToDoForNewJobs({index});caluculateMyHoursTODO({index});"  class="numberVal t-tip newEstimatePages" name="job.estimatePages" id="estpages-{index}"  value="" title="<fmt:message bundle='${help}' key='help.qgl.EST_PGS'/>">
			<!--title="Enter Value"-->
        </div>
<!-- onchange="calculateTotalHrs({index})" -->
        <div class="job-column scopist" id="scopist-{index}">
            <input type="hidden" id="scopist-id-{index}" class="scopist-id" name="job.scopistId" value=""/>
            <input  onBlur="caluculateMyHoursTODO({index});" class="scopist-initial t-tip" maxlength="10" type="text" name="job.scopistInitial" value="" title="<fmt:message bundle='${help}' key='help.qgl.SCOPIST'/>"/>
            <input type="hidden" class="scopist-name" name="job.scopistName" value=""/>
        </div>
        <div class="job-column proofer" id="proofer-{index}">
            <input type="hidden" id="proofer-id-{index}" class="proofer-id" name="job.prooferId" value=""/>
            <input  onBlur="caluculateMyHoursTODO({index});" class="proofer-initial t-tip" maxlength="10" type="text" name="job.prooferInitial" value="" title="<fmt:message bundle='${help}' key='help.qgl.PROOFER'/>"/>
            <input type="hidden" class="proofer-name" name="job.prooferName" value=""/>
        </div>

        <div class="job-column case-name">
            <input style="max-width:120px;" type="text" class="t-tip" name="job.caseName" value="" title="<fmt:message bundle='${help}' key='help.qgl.CASE/JOB_NAME'/>">
        </div>
        <div class="job-column agency-due  date">
            <input class="date-picker" type="text" name="job.agencyDueDate" id="job.agencyDueDate-{index}" value="" readonly="readonly">
        </div>
        <div class="job-column total-hrs">
            <input type="text" id="totalhrs-{index}" readonly="readonly"  name="job.toDoHours" value="" title="<fmt:message bundle='${help}' key='help.qgl.HOURS_TO_DO'/>" class="t-tip">
        </div>
        
        <div class="job-column actions">
            <input type="submit" name="saveJob"  value="save"  src="${pageContext.request.contextPath}/images/save.gif" title="<fmt:message bundle='${help}' key='help.qgl.SAVE'/>" class="t-tip">
        </div>
        <input type="hidden" id="skillType-{index}"  name="job.skillType" value=""/>
        <input type="hidden" id="skillAdminHrs-{index}"  name="job.skillAdminHrs" value=""/>
        <input type="hidden" name="newjobIndex" class="newjobIndex" value="{index}"/>
        <div class="processImage"></div>
    </form>

</div>
<!-- Begin InformationText -->
<div style="overflow:hidden;height: 78%;top:120px;display: none;" id="infoContainer">
  <div id="infoContent" class="infoContentContainer">
    <div style="text-align:right;padding:0px;margin:0px;margin-top:-5px;"><img src="images/delete-icon.gif" width="16" height="16" alt="Close" id="infoclose" style="cursor:pointer;"/></div>
    
    	<div class="insContent" style="height: 430px;">
    		<h3>FIRST USE QGL</h3>
<p><strong>QGL TAB</strong><strong> - TABBING THROUGH QGL THE FIRST TIME:</strong></p>
  Click the <strong>+ADD </strong>icon to the right to enter a new job!   STATUS IS PEN=PENDING – AUTOMATED BY QGL</p>
 <p> <strong> AGENCY</strong> – Enter initials or shortened name.   Then enter full agency or client name to create the accounts receivable  rate table for this agency.</p>
  <strong>DATE TAKEN</strong> – Enter the actual date of the job (a calendar will pop up set to current date  for ease of use)</p>
<p>  <strong>EST. PAGES</strong> – Enter estimated number of pages, usually rounded in increments of 5 for  ease.  (<strong>ACTUAL</strong> pages  filled in upon completion of the job. )</p>
  If you scope or proof  yourself, <strong>Self</strong> is auto-filled in the  field so you know you are designated that time </p>
<p>  <strong>SCOPIST</strong> –  Enter initials or shortened name.  Then  complete the full name to designate to whom the job is sent and create the  accounts payable rate table for the scopist.</p>
  <strong>PROOFER</strong> –  Enter initials or shortened name.  Then  complete the full name to designate to whom the job is sent and create the  accounts payable rate table for the proofreader.</p>
<p>  <strong>CASE/JOBNAME </strong>–  Enter shortened name – in the future you can easily see where you've taken the  same case before and utilize a previous job dictionary.   Enter Case Number here or in Notes  section. </p>
<p>  <strong>DUE AGENCY</strong>–  Enter the date the job is due to the agency</p>
<p>  <strong>HOURS TO DO</strong> – Based on the information entered in the <strong>My Hours to Perform Task</strong> and  delegation of scopist or proofreader, this information indicates at a GLANCE how much time you need to set aside  to complete your tasks.</p>
<p><strong>ACTIONS</strong> –  Save</p>
<hr>
<h3>SECOND USE – PENDING</h3>
  <strong>EACH ACCOUNTS  RECEIVABLE AND ACCOUNTS PAYABLE HAS ITS OWN RATE TABLE</strong>
<p><strong>AGENCY</strong>  - hyperlink takes you to the Rate Table.  Clicking on Master Rate Table will open up 
  QGL- created <strong>MASTER RATE TABLE A/R </strong>codes.  Please choose by clicking the Code  box.</p>
  You may enter the VALUE here and it saves in the Rate  Table <strong>OR</strong> you may choose the code now  and enter the VALUE on the Rate Table later.   APPLY RATE CODE</p>
 <p> <strong>SCOPIST</strong>  - hyperlink takes you to the Rate Table.  Clicking on Master Rate Table will open up 
  QGL- created <strong>MASTER RATE TABL A/P </strong>codes.  Please choose by clicking the Code  box.  </p>
  You may enter the VALUE here and it saves in the Rate  Table <strong>OR</strong> you may choose the code now  and enter the VALUE on the Rate Table later.</p>
 <p> <strong>PROOFER</strong> - hyperlink takes you to the Rate Table.   Clicking on Master Rate Table will open up
  QGL- created <strong>MASTER RATE TABLE A/P </strong> codes.  Please choose by clicking the  Code box.  </p>
  You may enter the VALUE here and it saves in the Rate  Table <strong>OR</strong> you may choose the code now  and enter the VALUE on the Rate Table later.</p>
    	
    	</div>

    
  </div>
  <div style="float:right;color:#FFF;"><a href="#" id="slidebutton1"><img src="images/infoicon.png"  alt="Information" border="0" /></a></div>
  
</div>
 <!-- End InformationText -->   

<script type="text/javascript">
function caluculateMyHoursTODO(index){
	
     var totalHours = 0;
	 var hoursForProof = 0;
	 var hoursForScope  = 0;
	 var scopeHours = 0;
	 var proofHours = 0;
	 
	 var regularScopeHours = ${actionBean.myHoursToDo.regularScopeHours};
	 var regularProofHours = ${actionBean.myHoursToDo.regularProofHours};
	 var denseScopeHours = ${actionBean.myHoursToDo.denseScopeHours};
	 var denseProofHours = ${actionBean.myHoursToDo.denseProofHours};
	 var easyScopeHours = ${actionBean.myHoursToDo.easyScopeHours};
	 var easyProofHours = ${actionBean.myHoursToDo.easyProofHours};
	 var defaultAdministrativeHours = ${actionBean.myHoursToDo.administrativeHours};
	 var defaultSkillType = ${actionBean.myHoursToDo.defaultSkillType};
	 var selectedSkillType =  ${actionBean.myHoursToDo.defaultSkillType};
	 var administrativeHours = ${actionBean.myHoursToDo.administrativeHours};
	 var totalPages = $("#estpages-"+index).val();
	 
	 var SkillType = $("#skillType-"+index).val();
	 
	 var selectedSkillAdminHrs = $("#skillAdminHrs-"+index).val();
	 
	 if($.trim(SkillType).length > 0 && SkillType > 0){
		 selectedSkillType = parseInt(SkillType,10);
	 }else{
		 selectedSkillType = defaultSkillType;
	 }
	 
	 if($.trim(selectedSkillAdminHrs).length > 0 && selectedSkillAdminHrs > 0){
		 administrativeHours = parseFloat(selectedSkillAdminHrs,10);
	 }else{
		 administrativeHours = administrativeHours;
	 }
	 if(selectedSkillType == 1 || selectedSkillType == "1"){	 
	    scopeHours = regularScopeHours;
	    proofHours = regularProofHours;
	 }
	 else if(selectedSkillType == 2 || selectedSkillType == "2"){	 
		    scopeHours = denseScopeHours;
		    proofHours = denseProofHours;
	 }
	 else if(selectedSkillType == 3 || selectedSkillType == "3"){	 
		    scopeHours = easyScopeHours;
		    proofHours = easyProofHours;
	 }
	 var userId = '${actionBean.userId}';	
	 
	 
	  if(proofHours != 0)
	   hoursForProof = totalPages/proofHours;
	  
	  if(scopeHours != 0)
	   hoursForScope = totalPages/scopeHours; 
	
	  if($('#scopist-id-'+index).val() == "" && $('#proofer-id-'+index).val() == ""){		  
		  totalHours = administrativeHours + hoursForProof + hoursForScope; 
		  $('#totalhrs-'+index).val(Math.round(totalHours*Math.pow(10,2))/Math.pow(10,2));
		  return false;		  
	  }
	  
	  if($('#scopist-id-'+index).val() == "" && $('#proofer-id-'+index).val() != userId){		  
		  totalHours = administrativeHours +hoursForScope;	 
		   $('#totalhrs-'+index).val(Math.round(totalHours*Math.pow(10,2))/Math.pow(10,2));
		  return false;
	 }
	  
	  if($('#proofer-id-'+index).val() == "" && $('#scopist-id-'+index).val() != userId){		  
		  totalHours = administrativeHours +hoursForProof;
		   $('#totalhrs-'+index).val(Math.round(totalHours*Math.pow(10,2))/Math.pow(10,2));
		  return false;
	  }
	  
	  if($('#scopist-id-'+index).val() == "" && $('#proofer-id-'+index).val() == userId){		  
		  totalHours = administrativeHours +hoursForScope+hoursForScope;	 
		   $('#totalhrs-'+index).val(Math.round(totalHours*Math.pow(10,2))/Math.pow(10,2));
		  return false;
	 }
	  
	  if($('#proofer-id-'+index).val() == "" && $('#scopist-id-'+index).val() == userId){		  
		  totalHours = administrativeHours +hoursForProof+hoursForScope;
		   $('#totalhrs-'+index).val(Math.round(totalHours*Math.pow(10,2))/Math.pow(10,2));
		  return false;
	  }
	  
	 if( userId == $('#scopist-id-'+index).val() && userId == $('#proofer-id-'+index).val())
		totalHours = administrativeHours + hoursForProof + hoursForScope; 	
	 else if (userId == $('#scopist-id-'+index).val() && userId != $('#proofer-id-'+index).val())
		totalHours = hoursForScope + administrativeHours;
	 else if (userId != $('#scopist-id-'+index).val() && userId == $('#proofer-id-'+index).val())
		totalHours = hoursForProof + administrativeHours;
	 else
		totalHours = administrativeHours;

	 $('#totalhrs-'+index).val(Math.round(totalHours*Math.pow(10,2))/Math.pow(10,2));
}
function getSelectedPageJobs(pageid){
		if(pageid > 0)
		pageid = pageid -1;
		window.location = "qgl-log-pending.action?offset="+pageid;
	} 
</script> 
<style>
.ketchup-errorPar{position:relative;}
.ketchup-errorPar .ketchup-error{position:absolute;left: 47px;
    top: -61px;
    width: 100px;}

.toolTip-cust{position:relative;height:auto;}
.toolTip-cust span{
    display:none; position:absolute;
    top:-68px; left:-75px; width:14em;
	font:10px;
   background: rgb(254,252,234); /* Old browsers */
background: -moz-linear-gradient(top,  rgba(254,252,234,1) 0%, rgba(241,218,54,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,252,234,1)), color-stop(100%,rgba(241,218,54,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  rgba(254,252,234,1) 0%,rgba(241,218,54,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  rgba(254,252,234,1) 0%,rgba(241,218,54,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  rgba(254,252,234,1) 0%,rgba(241,218,54,1) 100%); /* IE10+ */
background: linear-gradient(to bottom,  rgba(254,252,234,1) 0%,rgba(241,218,54,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefcea', endColorstr='#f1da36',GradientType=0 ); /* IE6-9 */

    color: #000;
    text-shadow: 0 1px 0 #fff;
	padding:5px;
	border-radius:5px;
	text-align:center;
	border:1px solid #578EB8;
	z-index:99999999999;
	height:45px;
    
}
.toolTip-cust span:after{content:"";border:5px solid transparent;border-top:5px solid #578EB8;top:100%;position:absolute;left:45%;}

.toolTip-cust:focus span,.toolTip-cust:hover span{display:block;
   }
   
.profile-block table tr:first-child td:first-child .toolTip-cust span{top:-172px;}
.profile-block table tr:first-child td:nth-child(3) .toolTip-cust span{top:-204px;}
.profile-buttons .toolTip-cust span{width:8em;height:75px;left:-88px;top:-73px;}


.dd_menu {padding:0px; margin:0; list-style-type:none;}
.dd_menu li {float:left; border-right: solid 1px white;display:inline;}
.dd_menu li a {padding:0px 20px; display:block; color:#fff; text-decoration:none; font:12px arial, verdana, sans-serif; font-weight: bold;}
.dd_menu li:hover a {text-decoration:underline;}

.dd_menu ul {position:absolute; left:-9999px; top:-9999px; list-style-type:none;}
.dd_menu li:hover {position:relative; background:none;}
.dd_menu li:hover ul {left:-25px; top:15px; padding:3px; border:1px solid grey; width:auto;}
.dd_menu li:hover ul li {border:none;}
.dd_menu li:hover ul li a {height:18px;color:#003366; padding:5px 0px; display:block; font-size:11px; width:140px; line-height:18px; text-indent:5px; color:#444; background:#d0e0ea; text-decoration:none; border:1px solid transparent;}
.dd_menu li:hover ul li a:hover {height:18px; background:#c4d8e6; color:#003366; border:solid 1px #444;}

.proofer h4,.scopist h4,.agency h4{border-radius:5px;margin:5px;}
.proofer .toolTip-caption,.agency .toolTip-caption,.scopist .toolTip-caption {height:70px;top:-100px;}
.agency .toolTip-caption {left:-47px;}
#label{padding-left:10px;}
.label{width:75px;display:inline-table;}
.selectedTask{background:#9FBFFC;}

#rateItemCode .inputs, .input-value {width: 85%;}
#rateItemCode input[type="text"] {border-radius: 5px 5px 5px 5px;}
#modalratetable .code-name, #modalratetable .code-name:focus, #modalratetable .code-name:hover {
    background: none repeat scroll 0 0 #DDDDDD;
    color: black;
}
.ui-dialog-content .inputs, select {border: 1px solid #D4D4D4;padding: 3px;}
.input-desc {width: 95%;}
table select {width: 100%;}
</style>   

<script>


var agyIntlsArray = new Array();
var prfIntlsArray = new Array();
var scpIntlsArray = new Array();

scopist();
function scopist(){
	 <c:forEach items="${actionBean.scopistInitialsList}" var="scpIntls" varStatus="loop">
		scpIntlsArray.push('${scpIntls.initial}');	 
    </c:forEach>
    
    
	
}

proofer();

function proofer(){
	
	 <c:forEach items="${actionBean.prooferInitialsList}" var="prfIntls" varStatus="loop">
		prfIntlsArray.push('${prfIntls.initial}');			 
     </c:forEach>


}

agency();

function agency(){
	<c:forEach items="${actionBean.agencyInitialsList}" var="agyIntls" varStatus="loop">
	agyIntlsArray.push('${agyIntls.initial}');			 
</c:forEach>

	
}

</script> 

                     